<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/vue.js"></script>
    <style>
        #btn{
            height: 50px;
            width: 50px;
        }
    </style>
</head>
<body>
    <div id="app">
        <div>{{num}}</div>
        <div v-on:click="handle0">
            <!-- .stop阻止冒泡
                    <a v-on:click.stop="handle">跳转</a>    
                 .prevent阻止默认行为
                     <a v-on:click.prevent="handle">跳转</a> 
            -->
            <button id="btn" v-on:click.stop="handle1">点击</button>
        </div>
        <div><a href="http://www.baidu.com" v-on:click.prevent="handle2">跳转</a></div>
        
    </div>

    <script>
        var vm = new Vue({
            el:'#app',
            data:{
                num:0
            },
            methods:{
                handle0:function(){
                    this.num++;
                },
                handle1:function(event){
                    console.log(this);
                    //传统阻止冒泡
                    // event.stopPropagation();
                },
                handle2:function(event){
                    //传统阻止默认行为
                    // event.preventDefault();
                }
            }
        });
    </script>
</body>
</html>